<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<head th:replace="header :: common_header(~{::title},~{::link})">
    <title>秒到2.0商户管理后台</title>
</head>

<body class="page-header-fixed page-sidebar-closed-hide-logo page-content-white">
    <div class="page-wrapper">
        <div class="page-header navbar navbar-fixed-top" th:insert="~{index :: navbar-top}">
        </div>
        <div class="clearfix"> </div>
        <div class="page-container">
            <div class="page-sidebar-wrapper" th:insert="~{index :: sidebar}">
            </div>
			<div class="page-content-wrapper">
				<div class="page-content">
					<!--<div class="page-bar">
						<ul class="page-breadcrumb">
							<li><a href="#">首页</a> <i class="fa fa-circle"></i></li>
							<li><a href="#">业务管理</a> <i class="fa fa-circle"></i></li>
							<li><span>代理商管理</span></li>
						</ul>
					</div>-->
					<div class="row">
						<div class="col-md-12">
							<div class="portlet light bordered">
								<div class="portlet-title">
									<div class="caption font-dark">
										<i class="icon-settings font-dark"></i> <span
											class="caption-subject bold uppercase"> 添加代理商</span>
									</div>
								</div>
								
								
								<div class="portlet-body">
									<div class="table-toolbar">
										<div class="row">
											<div class="col-md-6"></div>
											<div class="col-md-6">
												<div class="btn-group pull-right">
													<button id="modal_sure_new" class="btn sbold green">
														保存 
													</button>
													<button id="btn_cancle" class="btn default">
														取消 
													</button>
												</div>
											</div>
										</div>
									</div>

									<div id="modal_new_role">
										<!-- 表单提交-->
										<form action="" method="PUT" id="form_role_new"
											class="form-horizontal">
											<div class="form-body">
												<div class="alert alert-danger display-hide">
													您填写的信息有错误，无法提交，请检查。</div>
												<div class="alert alert-success display-hide">
													表单填写完毕，正在提交...</div>
												<div class="alert alert-warning display-hide">
													提交失败，请联系客服！</div>
												<div class="form-group"  >
													<div class="col-md-5" >
														<span class="help-block text-center" ></span> 
														<input type="hidden" name="id" th:value="${entity.id}">
													</div>
												</div>
												<div  th:if="${#strings.isEmpty(entity.id)}" >
												<div class="form-group">

													<lable class="col-md-3 control-label"> <span
														class="required"> * </span>手机号：</lable>
													<div class="col-md-5">

														<input type="text" class="form-control "
															name="phone"  onchange="getPwdandAd()"
															placeholder="请输入手机号" >
													</div>
												</div>
												</div>
												
													<div  th:unless="${#strings.isEmpty(entity.id)}" >
												<div class="form-group">

													<lable class="col-md-3 control-label"> <span
														class="required"> * </span>手机号：</lable>
													<div class="col-md-5">

														<input type="text" class="form-control "
															name="phone"  onchange="getPwdandAd()"
															placeholder="请输入手机号" readonly th:value="${entity.phone}" >
													</div>
												</div>
												</div>
												
												<div class="form-group">

													<lable class="col-md-3 control-label"> <span
														class="required"> * </span>账号：</lable>
													<div class="col-md-5">

														<input type="text" class="form-control "
															name="loginName" 
															placeholder="自动生成" readonly th:value="${loginName}" >
													</div>
												</div>
										<div   th:if="${#strings.isEmpty(entity.id)}" >
												<div class="form-group">
													<lable class="col-md-3 control-label">
													<span class="required"> * </span>密码：</lable>
													<div class="col-md-5">
														<input type="text" class="form-control " 
															name="password" placeholder="自动生成" readonly th:value="${password}">
													</div>
												</div>
											 </div>
												<div class="form-group">
													<lable class="col-md-3 control-label">
													<span class="required"> * </span>代理商联系人：</lable>
													<div class="col-md-5">
													 <input type="text" class="form-control "  maxlength="40"
															name="contractName" placeholder="代理商联系人" th:value="${entity.contractName}">
														
													</div>
												</div>
												
												<div class="form-group">
													<lable class="col-md-3 control-label">
													<span class="required"> * </span>代理商级别：</lable>
													<div class="col-md-5">
                                            
                                            <select    name="levelId"  id="levelId">
											    
											      <option value="">请选择代理商级别</option>
                        						<option  th:each="levelId:${levelIdList}" th:value="${levelId.id}"   th:selected="${entity.levelId==levelId.id}"   th:text="${levelId.name }"></option>
											 </select>                                         
										</div>
									</div>
											<div class="form-group">	
													<lable class="col-md-3 control-label"><span class="required"> * </span>代理套数：</lable>
													<div class="col-md-5">
												<div id="checkbox_new" th:if="${#strings.isEmpty(entity.id)}" >
                                                    <input type="number" class="form-control "
															name="totalCount"  th:value="${entity.totalCount}">                 
                                        </div>
                                        
                                        <div   th:if="${not #strings.isEmpty(entity.id)}" >
                                                <input type="text" class="form-control "
															name="totalCount"  th:value="${entity.totalCount}" readonly>
                                        </div>
                                        
                                    </div>
											</div>	
												
											<!-- 	<div class="form-group" th:if="${templatesno}">
												<lable  class="col-md-3 control-label" >
													<span class="required"> * </span>模板：
													</lable>
													<div class="col-md-5">
													   <span>
														<input th:each="template : ${templatesno}"   type="checkbox" name="templateId"    th:text="${template}" th:value="${template}">　　
														<input th:each="template : ${templates}"   type="checkbox" name="templateId"  checked="checked"  th:text="${template}" th:value="${template}">
														</span>
													</div>
												</div> -->
												
												
												
												<div class="form-group">	
													<lable class="col-md-3 control-label">
													<span class="required"> * </span>类型：</lable>
													<div class="col-md-5">
												<div id="checkbox_new" th:if="${not #lists.isEmpty(mList)}" >
			                                        <label th:each="m:${mList}" class="margin-right-10" >
		                                                <input type="radio" name="type" th:checked="${m.type==entity.type}"   th:value="${m.type}"  th:text="${m.type }">
		                                            </label>                                          
                                        </div>
                                        
                                        <div  th:if="${ #lists.isEmpty(mList)}" >
                                                <input type="text" name="type" class="form-control " th:value="${entity.type}" readonly >
                                        </div> 
                                        
                                    </div>
											</div>	
												
												
													<div class="form-group">
													<lable class="col-md-3 control-label"><span class="required"> * </span>代理商名称：</lable>
													<div class="col-md-5">

														<input type="text" class="form-control "  maxlength="40"
															name="name"  th:value="${entity.name}" placeholder="代理商名称" >
													</div>
												</div>
												
												<div id="distpicker" data-toggle="distpicker">
													<div class="form-group">
													<lable class="col-md-3 control-label"><span class="required"> * </span>省份：</lable>
													<div class="col-md-5">
														<select  name="province"  th:value="${entity.province}"></select>
														</div>
													</div>
							                      	<div class="form-group">
							                      	<lable class="col-md-3 control-label"><span class="required"> * </span>城市：</lable>
							                      	<div class="col-md-5">
														<select  name="city"  th:value="${entity.city}" ></select>
													</div>
														</div>
							                    </div>
												
											<!-- 	<div class="form-group">
													<lable class="col-md-3 control-label"><span class="required"> * </span>省份：</lable>

													<div class="col-md-5">

														<input type="text" class="form-control "
															name="province"  th:value="${entity.province}" placeholder="省份" >
													</div>
												</div>
												
												<div class="form-group">
													<lable class="col-md-3 control-label"><span class="required"> * </span>城市：</lable>

													<div class="col-md-5">

														<input type="text" class="form-control "
															name="city"  th:value="${entity.city}" placeholder="城市" >
													</div>
												</div> -->
												
												
													<div class="form-group">

													<lable class="col-md-3 control-label">地址：</lable>
													<div class="col-md-5">

														<input type="text" class="form-control "  maxlength="100"
															name="address"  th:value="${entity.address}" placeholder="请输入商户地址" >
													</div>
												</div>
												
												

											</div>
											<!-- <div class="modal-footer">
												<button type="submit" class="btn green">提交</button>
												<button id="btn_cancle" class="btn default">取消</button>
											</div> -->
										</form>
										<!-- 表单提交-->
									</div>



								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		
        </div>
        <div class="page-footer">
            <div class="page-footer-inner"> 2017 &copy; 秒迅科技</a>
            </div>
            <div class="scroll-to-top">
                <i class="icon-arrow-up"></i>
            </div>
        </div>
    </div>
    <!-- 业务js -->
    <script th:src="@{/assets/pages/scripts/agent.js}" type="text/javascript"></script>
  <script th:inline="javascript">
			var provincetxt = [[${entity.province}]];
			var citytxt = [[${entity.city}]];
			//省市区赋值
			$("#distpicker").distpicker({
			  province: provincetxt,
			  city: citytxt
			});
		</script>
    
    
    
</body>

</html>